package cn.imvc.data.jpa.repository;

import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
import org.springframework.data.jpa.repository.config.AuditingBeanDefinitionParser;
import org.springframework.data.repository.config.RepositoryBeanDefinitionParser;
import org.springframework.data.repository.config.RepositoryConfigurationExtension;

public class IJpaRepositoryNameSpaceHandler extends NamespaceHandlerSupport {

	public void init() {
		RepositoryConfigurationExtension extension = new IJpaRepositoryConfigExtension();
		RepositoryBeanDefinitionParser repositoryBeanDefinitionParser = new RepositoryBeanDefinitionParser(extension);

		registerBeanDefinitionParser("repositories", repositoryBeanDefinitionParser);
		registerBeanDefinitionParser("auditing", new AuditingBeanDefinitionParser());
		
	}

}
